# -*- bazel -*-

load("@drake//tools/install:install.bzl", "install")
load("@drake//tools/skylark:cc.bzl", "cc_library")

licenses(["notice"])  # Apache 2.0

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "usockets",
    hdrs = ["src/libusockets.h"],
    srcs = glob([
        "src/*.c",
        "src/eventing/*.c",
        "src/crypto/*.c",
        "src/**/*.h",
    ]),
    includes = ["src"],
    isystem = True,
    copts = [
        "-DLIBUS_NO_SSL",
        "-fvisibility=hidden",
        "-w",
    ],
    linkstatic = 1,
)

# Install the license file.
install(
    name = "install",
    docs = ["LICENSE"],
)

exports_files(["drake_repository_metadata.json"])
